/**
 * 
 */
package com.devmindset.legoframework.client.mvc.metadata;

import com.devmindset.legoframework.client.mvc.EventMonitor;

/**
 * {@link Story} for the {@link EventMonitor}.
 * 
 * @author <a href="mailto:ice.penov@devmindset.com">Ice Penov</a>
 */
public class EventMonitorStory implements Story {
  
  private Enum<?>[] canHandle;
  private String knownAs;
  
  /**
   * Constructor.
   */
  EventMonitorStory() {}
  /**
   * Events I can handle.
   * 
   * @param types I (the controller) declare to handle
   * @return .
   */
  public EventMonitorStory canHandle(Enum<?>...types) {
    this.canHandle = types;
    return this;
  }
  
  /**
   * Knows as - description string.
   * 
   * @param description the string
   * @return .
   */
  public EventMonitorStory knownAs(String description) {
    this.knownAs = description;
    return this;
  }

  /**
   * Returns the canHandle.
   *
   * @return the canHandle
   */
  public Enum<?>[] getCanHandle() {
    return canHandle;
  }

  /**
   * Returns the knownAs.
   *
   * @return the knownAs
   */
  public String getKnownAs() {
    return knownAs;
  }
  
  /**
   * {@inheritDoc}
   */
  @Override
  public String toString() {
    if (knownAs != null) {
      return knownAs;
    } else {
      return super.toString();
    }
  }
  
}